package org.jeecg.codegeneweb.template;

import lombok.Data;

import java.io.File;

@Data
public class TemplateSingleFileDomain {
    private File templatefile;// file "D:\\book20241011\\jeecg\\JeecgBoot-3.7.1\\jeecg-boot\\jeecg-module-system\\jeecg-system-biz\\src\\main\\resources\\jeecg\\code-template-online\\default\\one\\java";
    private String templatefilename;//"D:\\book20241011\\jeecg\\JeecgBoot-3.7.1\\jeecg-boot\\jeecg-module-system\\jeecg-system-biz\\src\\main\\resources\\jeecg\\code-template-online\\default\\one\\java";
    private boolean isDir=false;
    private String originalRelativePath;//这个地址，替换之后需要与新的目标地址进行整合
    private String originalOnlyFileName;
    private String originalAbsolutePath;
    private String afterreplaceRelativePath;
    private String afterreplaceOnlyFileName;
    private String afterreplaceAbsolutePath;


    private TemplateLocaltion templateLocaltion;
    private DestinationSingleFileDomain destinationSingleFileDomain;
    public File getTemplatefile() {
        return templatefile;
    }

    public void setTemplatefile(File templatefile) {
        this.templatefile = templatefile;
    }
    public String getTemplatefilename() {
        return templatefilename;
    }
    public void setTemplatefilename(String templatefilename) {
        this.templatefilename = templatefilename;
    }

    public boolean isDir() {
        return isDir;
    }

    public void setDir(boolean dir) {
        isDir = dir;
    }

    public String getOriginalRelativePath() {
        String filename=getTemplatefile().getAbsolutePath().substring(getTemplatefilename().length(), getTemplatefile().getAbsolutePath().length());
        System.out.println(filename);
        return filename;
    }

    public void setOriginalRelativePath(String originalRelativePath) {
        this.originalRelativePath = originalRelativePath;
    }

    public String getOriginalOnlyFileName() {
        return getTemplatefile().getName();
    }

    public void setOriginalOnlyFileName(String originalOnlyFileName) {
        this.originalOnlyFileName = originalOnlyFileName;
    }

    public String getOriginalAbsolutePath() {
        return getTemplatefile().getAbsolutePath();
    }

    public void setOriginalAbsolutePath(String originalAbsolutePath) {
        this.originalAbsolutePath = originalAbsolutePath;
    }

    public String getAfterreplaceRelativePath() {
        return afterreplaceRelativePath;
    }

    public void setAfterreplaceRelativePath(String afterreplaceRelativePath) {
        this.afterreplaceRelativePath = afterreplaceRelativePath;
    }

    public String getAfterreplaceOnlyFileName() {
        return afterreplaceOnlyFileName;
    }

    public void setAfterreplaceOnlyFileName(String afterreplaceOnlyFileName) {
        this.afterreplaceOnlyFileName = afterreplaceOnlyFileName;
    }

    public String getAfterreplaceAbsolutePath() {
        return afterreplaceAbsolutePath;
    }

    public void setAfterreplaceAbsolutePath(String afterreplaceAbsolutePath) {
        this.afterreplaceAbsolutePath = afterreplaceAbsolutePath;
    }

    public DestinationSingleFileDomain getDestinationSingleFileDomain() {
        return destinationSingleFileDomain;
    }

    public void setDestinationSingleFileDomain(DestinationSingleFileDomain destinationSingleFileDomain) {
        this.destinationSingleFileDomain = destinationSingleFileDomain;
        this.destinationSingleFileDomain.setTemplateSingleFileDomain(this);
    }

    public TemplateLocaltion getTemplateLocaltion() {
        return templateLocaltion;
    }

    public void setTemplateLocaltion(TemplateLocaltion templateLocaltion) {
        this.templateLocaltion = templateLocaltion;
    }

    public static void main(String[] args) throws Exception {
        try {
            new File("d:\\tmp\\one\\two\\three").mkdirs();
            new File("d:\\tmp\\one\\two\\four").mkdirs();
        }catch (Exception ex){

        }


    }
}
